<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>添加友情链接</title>
    <style type="text/css">
		.checkbox{
			 margin-left:5px;
			 width:90px;
			 margin-top: 10px;
		}
		textarea{
			width: 300px;
			height: 100px;
		}
    </style>
    <link rel="stylesheet" type="text/css" href="__STATIC__/hdjs/hdjs.css"/>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.all.min.js"> </script>
     <script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
    <script src="__STATIC__/js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
     <script type="text/javascript">
    		$(function(){
    			//点击x 删除图片
    			$('.close').click(function(){
    				//父级td
    				var td = $(this).parents('td');
    				//获得完整路径
    				var path = $(this).attr('path');
    				//获得对应的aid
    				var fid = $(this).attr('fid');
    				$.ajax({
    					type:"post",
    					url:"{|U:'delImg'}",
    					data:{path : path,fid : fid},
    					success:function(){
    						//让图片隐藏
    						td.find('img').hide();
    						//组合input字符串
		    				var str = '<input type="file" name="logo" id="" />';
		    				//给td插入input
		    				td.html(str);
    					}
    				});
    				
    			})
    		})
    </script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">添加友情链接</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list">
            <tr>
                <th class="w100">链接名称</th>
                <td class="w100">
                    <input type="text" name="bname" class="w200" value="{$oldData.bname}"/> 
                </td>
                <td></td>
            </tr>
            
            <tr>
                <th class="w100">添加LOGO</th>
                <td>
                	<if value="$oldData['logo']">
                			<img src="__ROOT__/{$oldData.logo}" style="width:72px;height: 32px;"/>
                			<a href="javascript:;" style="color: red;" class="close" path="{$oldData.logo}" fid="{$oldData.fid}">X</a>
                			<input type="hidden" name="logo" value="{$oldData.logo}"/>
                		<else/>
                			<input type="file" name="logo" id="" /> 
                		</if>
					<!--<input type="file" name="logo" id="" value="{$oldData.logo}"/>--> 
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">是否热门</th>
                <td>
					<input type="checkbox" name="is_hot" value="1" <if value="$oldData['is_hot']==1">checked="checked"</if>  />
                </td>
                <td></td>
            </tr>
        
        </table>
        <div class="position-bottom">
        	<input type="hidden" name="bid" value="{$hd.get.bid}"/>
            <input type="submit" class="hd-success hd-btn hd-btn-danger" value="添加"/>
        </div>
    </form>
</div>
</body>
</html>